#include "tool.h"

int op_level(std::string op)
{
    if(op == "+" || op == "-") return 0;
    else if(op == "*" || op == "/") return 1;
    else if(op == "^") return 2;
    else if(is_func_name(op)) return 3;
    else return -1;
}

bool is_func_name(std::string name)
{
    for(int idx = 0; idx < NUM_FUNCS; idx++)
    {
        if(name == func_names[idx]) return true;
    }
    return false;
}
